package com.pj.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pj.project.model.pojo.SpGoodsWarehouse;
import com.pj.project.service.SpGoodsWarehouseService;
import com.pj.project.model.mapper.SpGoodsWarehouseMapper;
import lombok.val;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author hanwu
* @description 针对表【sp_goods_warehouse(物品仓库表)】的数据库操作Service实现
* @createDate 2022-12-23 18:18:42
*/
@Service
public class SpGoodsWarehouseServiceImpl extends ServiceImpl<SpGoodsWarehouseMapper, SpGoodsWarehouse>
    implements SpGoodsWarehouseService{

    @Resource SpGoodsWarehouseMapper SpGoodsWarehouseMapper;

    /**
     * 删除
     *
     * @return 是否删除成功
     */
    public boolean del(Integer id){
//        查询仓库是否存在
        if(SpGoodsWarehouseMapper.selectById(id) != null){
//            存在执行删除
            return SpGoodsWarehouseMapper.deleteById(id) != 0;
        }
        return false;
    }

}




